//
//  sui04macApp.swift
//  sui04mac
//
//  Created by 杨剑 on 2023/11/21.
//

import SwiftUI


@main
struct YJApp: App {
    
    @State var isPresentConfigAppkeyPage = false
    var body: some Scene {
        let _ = print(RestURLTemplate().arguments)
        let appModelData = AppkeyModelData()
        let restModelData = RestModelData()
//        WindowGroup {
//            TestView()
//        }

        WindowGroup {

            HomePage()
                .environment(appModelData)
                .environment(restModelData)
                .environment(\.colorScheme,.light)
                .background(Color(red: 0.9, green: 0.9, blue: 0.9)) // 自定义浅灰色背景
                .frame(minWidth: 1300,minHeight: 700) // 设置默认的窗口大小

        }

//        .environment(\.colorScheme,.light)

//        WindowGroup(id: "ConfigAppkeyPage"){
//            ConfigAppkeyPage()
//                .environment(appModelData)
//        }
        WindowGroup(id: "AddAppPage"){
            AddAppPage()
                .environment(appModelData)
                .environment(\.colorScheme,.light)
                .background(Color(red: 0.9, green: 0.9, blue: 0.9)) // 自定义浅灰色背景
        }
//        .environment(\.colorScheme,.light)

//        if isPresentConfigAppkeyPage{
//            WindowGroup {
//                ConfigAppkeyPage().environment(AppkeyModelData())
//            }
//        }

    }
}
